package com.bee.beemanage.api.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.bee.beemanage.api.entity.output.DepartmentTree;
import com.bee.beemanage.api.entity.SysDepartment;
import com.bee.beemanage.system.common.utils.result.Result;

import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 部门表 服务类
 * </p>
 *
 * @author 陈国松
 * @since 2022-10-09
 */
public interface SysDepartmentService extends IService<SysDepartment> {

    /**
     * 根据用户id构建部门树，用户id为null，则返回所有的部门树
     * @param userId
     * @return
     */
    List<DepartmentTree> selectDepartmentTreeByDepartmentId(String userId);

    Page<SysDepartment> recycleSearch(Page<SysDepartment> page, SysDepartment sysDepartment, LocalDateTime startTime, LocalDateTime endTime);

    boolean recover(List<String> idsList);


    Result clear();

    Result safeDeleteById(String id);
}
